#ifndef __RANDOM_H__
#define __RANDOM_H__

#include "stdafx.h"
#include "Timer.h"

namespace GeorgeLib
{
	namespace Random
	{

		inline void Init(void)
		{
			srand(Timer::getInstance()->GetTime());
		}

		inline bool Bool(void)
		{
			// Gives warning C4800, casting int to bool
			return bool(rand() % 2);
		}

		inline int Int(int min, int max)
		{
			if (min == max) return max;
			return rand() % (max - min) + min;
		}

		inline float Float(float min, float max)
		{
			if (min == max) return max;
			return (float)rand() / ((float)RAND_MAX / (max - min)) + min;
		}

		inline double Double(double min, double max)
		{
			if (min == max) return max;
			return (double)rand() / ((double)RAND_MAX / (max - min)) + min;
		}
	}
}

#endif